﻿
Partial Class Account_EmailVerification
    Inherits System.Web.UI.Page
    Dim u As MembershipUser
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        If Not Request.QueryString("id") Is Nothing Then
            Dim guid As New Guid(Request.QueryString("id"))
            u = Membership.GetUser(guid)
            If u.IsApproved = False Then
                lblMessage.Text = "Hello " & u.UserName & " your Email is not verified</br>"
            Else
                lblMessage.Text = "Hello " & u.UserName & " your Email is allready verified</br>"
            End If
        End If

    End Sub

    Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
        If u.IsApproved = False Then
            u.IsApproved = True
            Membership.UpdateUser(u)
            lblMessage.Text = "Hello " & u.UserName & " your Email is now verified</br>"
        Else
            lblMessage.Text = "Hello " & u.UserName & " your Email is allready verified</br>"
        End If

    End Sub
End Class
